import { request } from '@/utils/request'

//添加公告接口
export const addNotice = (formData) => request('/admin/addNotice', 'POST', formData)

//修改公告接口
export const updateNotice = (formData) => request('/admin/updateNotice', 'POST', formData)

//置顶公告接口
export const noticeToTop = (id) => request('/admin/noticeToTop', 'POST', { id })

//删除公告接口
export const delNotice = (id) => request('/admin/delNotice', 'POST', { id })

//获取所有咨询师接口
export const getConsultants = () => request('/admin/getAllConsultants', 'GET')

//添加咨询师接口
export const addConsultant = (formData) => request('/admin/addConsultant', 'POST', formData)

//删除咨询师信息接口
export const delConsultant = (id) => request('/admin/delConsultant', 'POST', { id })

//修改咨询师信息接口
export const updateConsultant = (formData) => request('/admin/updateConsultant', 'POST', formData)

//获取所有用户信息接口
export const getAllUsers = () => request('/admin/getAllUsers', 'GET')

//根据手机号查询咨询师id
export const getconsultant_idByaccount = (consultant_account) =>
  request('/admin/getconsultant_idByaccount', 'GET', { consultant_account })

//创建用户与咨询师的预约信息
export const createAppointment = (formData) => request('/admin/createAppointment', 'POST', formData)

//根据选择的日期查询空闲表中存在的空闲时间段
export const getavailableTimeBydateandis_booked = (id, date) =>
  request('/admin/getavailableTimeBydateandis_booked', 'GET', { id, date })

//查询数据库中设定的预约时间段原数据
export const gettimeperiods_admin = () => request('/admin/gettimeperiods_admin', 'GET')
